#coding=utf8
import ConfigParser, os, sys

class Getconfig(object):
    "get config"
    def __init__(self):
        self.config = ConfigParser.ConfigParser()
        self.config.readfp(open(os.path.join(os.path.split(os.path.abspath(sys.argv[0]))[0],'config')))
        self.debug = self.config.getint('CONFIG', 'debug')
        self.type = self.config.getint('CONFIG', 'type')
        self.logpath = os.path.join(os.path.split(os.path.abspath(sys.argv[0]))[0],self.config.get('CONFIG', 'logpath'))
        self.savepath = self.config.get('CONFIG', 'savepath')
        self.threadnum = self.config.get('CONFIG', 'threadnum')
        self.wgetpath = self.config.get('CONFIG', 'wget')
        # if system is windows use gbk path ,else utf-8
        if sys.platform.find('win') != -1:
            self.win = True
        else:
            self.win = False
